{{ define "youbbs" }}
<!doctype html>
<html lang="zh-cmn-Hans">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>{{.Title}}</title>
    <meta content="True" name="HandheldFriendly" />
    <meta name="viewport" content="maximum-scale=1.0,width=device-width,initial-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link href="/static/default/style_mobile.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/jquery.toast.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />
    <script src="/static/js/jquery.min.js" type="text/javascript"></script>
    <script src="/static/js/jquery.toast.js" type="text/javascript"></script>
    <script src="/static/js/md5.min.js" type="text/javascript"></script>
    <link rel="top" title="Back to Top" href="#" />
    <meta name="keywords" content="{{.Keywords}}" />
    <meta name="description" content="{{.Description}}" />

    <script src="/static/js/jquery.uploadifive.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="/static/css/uploadifive.css" />

    <link rel="stylesheet" href="/static/highligt/sunburst.min.css">
    <script src="/static/highligt/highlight.pack.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>

    <script type="text/javascript">
        $(function(){
            $("#go-to-top").click(function(){
                $("html, body").animate({"scrollTop": 0}, 400);
                return false;
            });
            $(window).scroll(function() {
                var top = $(document).scrollTop();
                var g = $("#go-to-top");
                if (top > 300 && g.is(":hidden")) {
                    g.fadeIn();
                } else if(top < 300 && g.is(":visible")) {
                    g.fadeOut();
                }
            });
        })

    </script>

</head>
<body>
<div class="hdlogo"><img src="/static/img/youbbs.jpg" alt="{{.SiteCf.Name}}"/></div>
<div class="header-wrap">
    <div class="header">
        <div class="logo"><a href="/" name="top">{{.SiteCf.Name}}</a></div>

        <div class="banner">

            {{if .CurrentUser.Id}}
            <a href="/member/{{.CurrentUser.Id}}"><img class="avatar avatar24" src="/static/avatar/{{.CurrentUser.Avatar}}.jpg" alt="{{.CurrentUser.Name}}"/></a>&nbsp;&nbsp;<a href="/setting">设置</a>&nbsp;&nbsp;<a href="/logout">退出</a>
            {{else}}
            {{if .SiteCf.WeiboClientID}}
            <a href="/wblogin" rel="nofollow"><img src="/static/img/weibo_login_55_24.png" alt="微博登录"/></a>
            {{end}}
            {{if .SiteCf.QQClientID}}
            <a href="/qqlogin" rel="nofollow"><img src="/static/img/qq_login_55_24.png" alt="QQ登录"/></a>
            {{end}}
            &nbsp;<a href="/login" rel="nofollow">登录</a>

            {{if and .SiteCf.WeiboClientID .SiteCf.QQClientID}}
            {{else}}
            {{if not .SiteCf.CloseReg}}
            &nbsp;&nbsp;<a href="/register" rel="nofollow">注册</a>
            {{end}}
            {{end}}

            {{end}}
        </div>
        <div class="c"></div>
    </div>
    <!-- header end -->
</div>

<div class="main-wrap">
    <div class="main">
        <div class="main-content">

            {{if .CurrentUser.Id}}

            {{if eq .CurrentUser.Flag 0}}
            <div class="tiptitle">站内提醒 &raquo; <span style="color:yellow;">帐户已被管理员禁用</span></div>
            {{else if eq .CurrentUser.Flag 1}}
            <div class="tiptitle">站内提醒 &raquo; <span style="color:yellow;">帐户在等待管理员审核</span></div>
            {{else}}

            {{if not .CurrentUser.Password }}
            <!--<div class="tiptitle">站内提醒 &raquo; <a href="/setting#3" style="color:yellow;">设置登录密码</a></div>-->
            {{end}}

            {{if gt .CurrentUser.NoticeNum 0}}
            <div class="tiptitle">站内提醒 &raquo; <a href="/notification" style="color:yellow;">{{.CurrentUser.NoticeNum}}条提醒</a></div>
            {{end}}

            {{end}}



            {{if eq .CurrentUser.Flag 99}}
            <div class="nav-title">管理员面板 <a href="https://www.youbbs.org/">youBBS官方支持</a></div>
            <div class="main-box main-box-node">
                <div class="btn">
                    <a href="/admin/category/list">分类管理</a>
                    <a href="/admin/user/list">用户管理</a>
                    <a href="/admin/link/list">链接管理</a>
                    <div class="c"></div>
                </div>

            </div>
            {{end}}

            {{end}}

            {{ template "content" . }}

            {{ template "side" . }}

        </div>
        <!-- main-content end -->
        <div class="c"></div>
    </div>
    <!-- main end -->
    <div class="c"></div>
</div>

<div class="footer-wrap">
    <div class="footer">
        <p class="float-left">&copy; <a href="/">{{.SiteCf.Name}}</a>
            • <a href="/view?tpl=desktop">桌面模式</a>
        </p>
        <p class="float-right">by <a href="https://www.youbbs.org" target="_blank">youBBS </a> - {{.SiteCf.GoVersion}}</p>
        <div class="c"></div>

    </div>
    <!-- footer end -->
</div>

</body>
</html>
{{ end }}



{{ define "side" }}

{{if eq .PageName "article_detail"}}
{{if .Relative.Tags}}
<div class="nav-title">相邻的标签</div>
<div class="main-box main-box-node">
    <div class="btn">
        {{range $_, $item := .Relative.Tags}}<a href="/tag/{{$item}}">{{$item}}</a> {{ end }}
        <div class="c"></div>
    </div>
    <div class="c"></div>
</div>
{{ end }}
{{ end }}

{{if .NewestNodes}}
<div class="nav-title">新增主题</div>
<div class="main-box main-box-node">
    <div class="btn">
        {{range $_, $v := .NewestNodes}}
        <a href="/n/{{$v.Id}}">{{$v.Name}}</a>
        {{end}}
        <div class="c"></div>
    </div>
    <div class="c"></div>
</div>
{{ end }}

{{if .HotNodes}}
<div class="nav-title">热门主题</div>
<div class="main-box main-box-node">
    <div class="btn">
        {{range $_, $v := .HotNodes}}
        <a href="/n/{{$v.Id}}">{{$v.Name}}</a>
        {{end}}
        <div class="c"></div>
    </div>
    <div class="c"></div>
</div>
{{ end }}

{{if eq .PageName "home"}}
{{if .Links}}
<div class="nav-title">链接</div>
<div class="main-box main-box-node">
    <div class="btn">
        {{range $_, $v := .Links}}
        <a href="{{$v.Url}}" target="_blank">{{$v.Name}}</a>
        {{end}}
    </div>
    <div class="c"></div>
</div>
{{ end }}

{{if .SiteInfo}}
<div class="nav-title">本站已稳定运行 {{.SiteInfo.Days}} 天</div>
<div class="main-box main-box-node">
    <ul class="bot-side-info">
        <li>会员: {{.SiteInfo.UserNum}}</li>
        <li>帖子: {{.SiteInfo.PostNum}}</li>
        <li>回复: {{.SiteInfo.ReplyNum}}</li>
        <li>分类: {{.SiteInfo.NodeNum}}</li>
        <li>标签: {{.SiteInfo.TagNum}}</li>
    </ul>
    <div class="c"></div>
</div>
{{ end }}
{{ end }}

{{ end}}

